﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NENAData.Factory;
using NENAData.EF;

namespace NENAData.Transactions
{
    public class TransactionList
    {
        public enum Transactions
        {
            Membership2007 = 1,
            Membership2008 = 2,
            Membership2009 = 4,
            Membership2010 = 5,
            ConferenceRegina2011 = 7,
            ConferenceRegina2012 = 8,
            Membership2011 = 9,
            Membership2012 = 10

        }
        public enum TransactionTypes
        {
            Membership,
            Conference
        }

        private static NENA_MembershipEntities GetConnection()
        {
            var x = new SQLMembership();
            return x.DBConnection();
        }

        /// <summary>
        /// Return a transaction based on its enum
        /// </summary>
        /// <param name="transactions"></param>
        /// <returns></returns>
        public Transaction GetTransaction(Transactions transactions)
        {

            NENA_MembershipEntities db = GetConnection();

            Transaction transaction = (from e in db.Transactions
                                       where e.TransactionID_NENA == (int)transactions 
                                     select e).SingleOrDefault();

            return transaction;
        }


    }
}
